package io;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * 缓冲流写出时的缓冲区问题
 */
public class FlushDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("fos.dat");
        BufferedOutputStream bop = new BufferedOutputStream(fos);
        String line = "雨下整夜，我的爱溢出就像雨水";
        bop.write(line.getBytes(StandardCharsets.UTF_8));
        System.out.println("完毕");
        bop.flush();



    }
}
